<template>
  <div>
    <van-image
      :width="width"
      :height="height" 
      :round="round"
      :src="src"
      :radius="radius"
      fit="cover"
      lazy-load
      use-loading-slot
      use-error-slot
      >
      <van-loading
        slot="loading"
        size="20" vertical 
        color="#1989fa"
        />
      <text slot="error">加载失败</text>
    </van-image>
  </div>
</template>

<script>
export default {
  props: {
    src: {
      type: String,
      requried: true
    },
    height: {
      type: String,
      default: "320rpx",
    },
    width: {
      type: String,
      default: "670rpx"
    },
    round: {
      type: Boolean,
      default: false
    },
    radius: {
      type: String,
      default: 0
    }
  }
}
</script>

<style lang="less" scoped>

</style>